<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>JSCODE</title>
<style>
html{
width:100%;
height:100%;
margin:0;
padding:0;
overflow:hidden;
}
body {
margin:0;
padding:0;
width:100%;
height:100%;
overflow:hidden;
font-size:12px;
font-family:"Andale Mono";
}
#main{
padding:10px 0 0 10px;
height:100%;
overflow:auto;
}
#pop_up{
position:absolute;
right:16px;
top:0;
padding:10px;
background:#fff;
overflow:auto;
border:1px solid #000;
}
dd{
margin-left:20px;
}
h2 a{
color:#006A00;
text-decoration:none;
}
h2 a:hover{
text-decoration:underline;
}
h3{
    color:#aaa;
}
.function_head{
    
}
.variable_head{

}
.example_html b{
    color:#0080C0;
}
p.description {
    border-left:3px solid #aaa;
    border-bottom:1px solid #aaa;
    padding-left:10px;
}
.code{
    border:1px solid #ccc;
    margin-top:5px;
    font-size:11px;
    background:#dedede;
    overflow:auto;
}
dl.item {
    margin-bottom:20px;
}
dl.item dt{
    margin-top:50px;
    background:#eee;
    margin-left:10px;
}
dl.item dt a{
    color:#FF7700;
}
dl.item dt b a{
    font-size:13px;
    color:#333;
    text-decoration:none;
}
dl.item dt b a:hover{
    font-size:13px;
    color:#333;
    text-decoration:underline;
}
li{border-bottom:1px dashed #ccc;line-height:25px}
li b{font-weight:normal}
#name_index{
    border-top:3px solid #ccc;
}
.c128{color:#ff0000}.c512{color:#004000}.c32{color:#008080}.c64{color:#949494}.c2{color:#ff0000}.c8{color:#008000}.c1{color:#0080c0}.c4{color:#ff8040}.c256{color:#000000}.c16{color:#800000}</style>
<script>
function view_source (a) {
    var c = a.parentNode.nextSibling;
    if (c.style.display == 'none') {
        c.style.display = 'block';
    } else {
        c.style.display = 'none';
    }
    return false;
}
</script>
</head>
<body>
<div id="main">
<h2><a name="Array" href="#Array">Array</a></h2><dl class="item"><dt><b class="function_head"><a name="Array.each" href="#Array.each">each</a></b>&nbsp;<a href="javascript:void(0)" onclick="view_source(this)">hide source</a></dt><dd class="code" style="display:block"><ol><li><b class="c2">Array</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">.</b><b class="c256">each</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c256">f</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">try</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c1">try</b><b class="c16">{</b>&nbsp;<b class="c256">f</b><b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">,</b>&nbsp;<b class="c256">i</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">catch</b><b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">if</b><b class="c16">(</b><b class="c256">e</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c256">$continue</b><b class="c16">)</b>&nbsp;<b class="c1">throw</b>&nbsp;<b class="c256">e</b><b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">catch</b>&nbsp;<b class="c16">(</b><b class="c256">e</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">e</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c256">$break</b><b class="c16">)</b>&nbsp;<b class="c1">throw</b>&nbsp;<b class="c256">e</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b></b></li></ol></dd><dd></dd><dt><b class="function_head"><a name="Array.include" href="#Array.include">include</a></b>&nbsp;<a href="javascript:void(0)" onclick="view_source(this)">hide source</a></dt><dd class="code" style="display:block"><ol><li><b class="c2">Array</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">.</b><b class="c256">include</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">indexOf</b><b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c8">-</b><b class="c128">1</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></b></li></ol></dd><dd><h3>Description:</h3><p class="description"> 数组中是否包含给定的值</p></dd><dt><b class="function_head"><a name="Array.indexOf" href="#Array.indexOf">indexOf</a></b>&nbsp;<a href="javascript:void(0)" onclick="view_source(this)">hide source</a></dt><dd class="code" style="display:block"><ol><li><b class="c2">Array</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">.</b><b class="c4">indexOf</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c1">this</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b>&nbsp;<b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">i</b><b class="c16">;</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">-</b><b class="c128">1</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></b></li></ol></dd><dd><h3>Description:</h3><p class="description"> 查找一个元素在数组中的索引，如果没有找到返回-1</p></dd><dt><b class="function_head"><a name="Array.last" href="#Array.last">last</a></b>&nbsp;<a href="javascript:void(0)" onclick="view_source(this)">hide source</a></dt><dd class="code" style="display:block"><ol><li><b class="c2">Array</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">.</b><b class="c256">last</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c8">[</b><b class="c1">this</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8">-</b>&nbsp;<b class="c128">1</b><b class="c8">]</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></b></li></ol></dd><dd><h3>Description:</h3><p class="description"> 返回数组的最后一个元素<br/>	 </p></dd></dl><h2><a name="Function" href="#Function">Function</a></h2><dl class="item"><dt><b class="function_head"><a name="Function.bind" href="#Function.bind">bind</a></b>&nbsp;<a href="javascript:void(0)" onclick="view_source(this)">hide source</a></dt><dd class="code" style="display:block"><ol><li><b class="c2">Function</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">.</b><b class="c256">bind</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">_t</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c16">,</b>&nbsp;<b class="c256">args</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">$A</b><b class="c16">(</b><b class="c4">arguments</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">.</b><b class="c4">shift</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_t</b><b class="c8">.</b><b class="c4">apply</b><b class="c16">(</b><b class="c256">o</b><b class="c16">,</b>&nbsp;<b class="c256">args</b><b class="c8">.</b><b class="c4">concat</b><b class="c16">(</b><b class="c256">$A</b><b class="c16">(</b><b class="c4">arguments</b><b class="c16">)</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b></b></li></ol></dd><dd></dd><dt><b class="function_head"><a name="Function.bindAsEventListener" href="#Function.bindAsEventListener">bindAsEventListener</a></b>&nbsp;<a href="javascript:void(0)" onclick="view_source(this)">hide source</a></dt><dd class="code" style="display:block"><ol><li><b class="c2">Function</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">.</b><b class="c256">bindAsEventListener</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">_t</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c16">,</b>&nbsp;<b class="c256">args</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">$A</b><b class="c16">(</b><b class="c4">arguments</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c256">o</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">args</b><b class="c8">.</b><b class="c4">shift</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c4">event</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">_t</b><b class="c8">.</b><b class="c4">apply</b><b class="c16">(</b><b class="c256">o</b><b class="c16">,</b>&nbsp;<b class="c8">[</b><b class="c4">event</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c4">window</b><b class="c8">.</b><b class="c4">event</b><b class="c8">]</b><b class="c8">.</b><b class="c4">concat</b><b class="c16">(</b><b class="c256">args</b><b class="c16">)</b><b class="c8">.</b><b class="c4">concat</b><b class="c16">(</b><b class="c256">$A</b><b class="c16">(</b><b class="c4">arguments</b><b class="c16">)</b><b class="c16">)</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b></b></li></ol></dd><dd></dd></dl><h2><a name="String" href="#String">String</a></h2><dl class="item"><dt><b class="function_head"><a name="String.camelize" href="#String.camelize">camelize</a></b>&nbsp;<a href="javascript:void(0)" onclick="view_source(this)">hide source</a></dt><dd class="code" style="display:block"><ol><li><b class="c2">String</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">.</b><b class="c256">camelize</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">list</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">split</b><b class="c16">(</b><b class="c64">'-'</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">pos</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c8">-</b><b class="c128">1</b><b class="c16">,</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">while</b><b class="c16">(</b><b class="c16">(</b><b class="c256">pos</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">indexOf</b><b class="c16">(</b><b class="c64">'-'</b><b class="c16">,</b>&nbsp;<b class="c256">pos</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c128">1</b><b class="c16">)</b><b class="c16">)</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c8">-</b><b class="c128">1</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">list</b><b class="c8">[</b><b class="c256">i</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c128">1</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">list</b><b class="c8">[</b><b class="c256">i</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c128">1</b><b class="c8">]</b><b class="c8">.</b><b class="c4">charAt</b><b class="c16">(</b><b class="c128">0</b><b class="c16">)</b><b class="c8">.</b><b class="c4">toUpperCase</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">list</b><b class="c8">[</b><b class="c256">i</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c128">1</b><b class="c8">]</b><b class="c8">.</b><b class="c4">substring</b><b class="c16">(</b><b class="c128">1</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">list</b><b class="c8">.</b><b class="c4">join</b><b class="c16">(</b><b class="c64">''</b><b class="c16">)</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b></b></li></ol></dd><dd><h3>Description:</h3><p class="description">  以camel命名规则格式化字符串 </p><h3>Example:</h3><fieldset class="example_code"><legend>Code</legend><ol><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c64">'z-index'</b><b class="c8">.</b><b class="c256">camelize</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c32">//&nbsp;'zIndex'</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<b class="c64">'font-size'</b><b class="c8">.</b><b class="c256">camelize</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c32">//&nbsp;'fontSize'</b></b></li></ol></fieldset></dd><dt><b class="function_head"><a name="String.decode" href="#String.decode">decode</a></b>&nbsp;<a href="javascript:void(0)" onclick="view_source(this)">hide source</a></dt><dd class="code" style="display:block"><ol><li><b class="c2">String</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">.</b><b class="c256">decode</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">decodeURIComponent</b><b class="c16">(</b><b class="c1">this</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></b></li></ol></dd><dd><h3>Description:</h3><p class="description"> 对字符串进行url编码<br/>	 </p></dd><dt><b class="function_head"><a name="String.encode" href="#String.encode">encode</a></b>&nbsp;<a href="javascript:void(0)" onclick="view_source(this)">hide source</a></dt><dd class="code" style="display:block"><ol><li><b class="c2">String</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">.</b><b class="c256">encode</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">encodeURIComponent</b><b class="c16">(</b><b class="c1">this</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></b></li></ol></dd><dd><h3>Description:</h3><p class="description">  对字符串进行url解码 <br/>	 </p></dd><dt><b class="function_head"><a name="String.format" href="#String.format">format</a></b>&nbsp;<a href="javascript:void(0)" onclick="view_source(this)">hide source</a></dt><dd class="code" style="display:block"><ol><li><b class="c2">String</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">.</b><b class="c256">format</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">s</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c16">;</b>&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c4">arguments</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c256">s</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">s</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c8">new</b>&nbsp;<b class="c2">RegExp</b><b class="c16">(</b><b class="c64">'\\{'</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c64">'\\}'</b><b class="c16">,</b>&nbsp;<b class="c64">'g'</b><b class="c16">)</b><b class="c16">,</b>&nbsp;<b class="c4">arguments</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c16">}</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">s</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></b></li></ol></dd><dd><h3>Description:</h3><p class="description">  按给定的参数顺序格式化字符串</p><h3>Example:</h3><fieldset class="example_code"><legend>Code</legend><ol><li><b class="c64">'{0}&nbsp;say&nbsp;:&nbsp;{1}&nbsp;get&nbsp;a&nbsp;{2}!'</b><b class="c8">.</b><b class="c256">format</b><b class="c16">(</b><b class="c64">'baboo'</b><b class="c16">,</b>&nbsp;<b class="c64">'benny'</b><b class="c16">,</b>&nbsp;<b class="c64">'cat'</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c32">//return&nbsp;'baboo&nbsp;say:&nbsp;benny&nbsp;get&nbsp;a&nbsp;cat!'</b></b></li></ol></fieldset></dd><dt><b class="function_head"><a name="String.getQueryParams" href="#String.getQueryParams">getQueryParams</a></b>&nbsp;<a href="javascript:void(0)" onclick="view_source(this)">hide source</a></dt><dd class="code" style="display:block"><ol><li><b class="c2">String</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">.</b><b class="c256">getQueryParams</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">paramStrs</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/^\??/</b><b class="c16">,</b>&nbsp;<b class="c64">''</b><b class="c16">)</b><b class="c8">.</b><b class="c4">split</b><b class="c16">(</b><b class="c64">'&'</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">ret</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c16">{</b><b class="c16">}</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">paramStrs</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">parts</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">paramStrs</b><b class="c8">[</b><b class="c256">i</b><b class="c8">]</b><b class="c8">.</b><b class="c4">split</b><b class="c16">(</b><b class="c64">'='</b><b class="c16">)</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">ret</b><b class="c8">[</b><b class="c256">parts</b><b class="c8">[</b><b class="c128">0</b><b class="c8">]</b><b class="c8">.</b><b class="c256">decode</b><b class="c16">(</b><b class="c16">)</b><b class="c8">]</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">parts</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b>&nbsp;<b class="c8">?</b>&nbsp;<b class="c256">parts</b><b class="c8">[</b><b class="c128">1</b><b class="c8">]</b><b class="c8">.</b><b class="c256">decode</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c8">:</b>&nbsp;<b class="c1">null</b><b class="c16">;</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">ret</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b></b></li></ol></dd><dd><h3>Description:</h3><p class="description">  由 pro=value&pro1=value1...的字符串解析得到一个Hash对象</p><h3>Example:</h3><fieldset class="example_code"><legend>Code</legend><ol><li>&nbsp;<b class="c64">'name=baboo&sex=male&country=%E4%B8%AD%E5%9B%BD'</b><b class="c8">.</b><b class="c256">getQueryParams</b><b class="c16">(</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c32">//&nbsp;return&nbsp;{name:'baboo',&nbsp;sex:'male',&nbsp;country:'中国'}</b></b></li></ol></fieldset></dd><dt><b class="function_head"><a name="String.isEmpty" href="#String.isEmpty">isEmpty</a></b>&nbsp;<a href="javascript:void(0)" onclick="view_source(this)">hide source</a></dt><dd class="code" style="display:block"><ol><li><b class="c2">String</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">.</b><b class="c256">isEmpty</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c8">/</b><b class="c8">^</b><b class="c8">[</b><b class="c8">\</b><b class="c256">s</b><b class="c8">　</b><b class="c8">]</b><b class="c8">*</b><b class="c8">$</b><b class="c8">/</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c1">this</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></b></li></ol></dd><dd><h3>Description:</h3><p class="description"> 判断一个字符串是否由空字符串组成<br/>	 </p></dd><dt><b class="function_head"><a name="String.process" href="#String.process">process</a></b>&nbsp;<a href="javascript:void(0)" onclick="view_source(this)">hide source</a></dt><dd class="code" style="display:block"><ol><li><b class="c2">String</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">.</b><b class="c256">process</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/\$\{([^\}]+)\}/g</b><b class="c16">,</b>&nbsp;<b class="c1">function</b>&nbsp;<b class="c16">(</b><b class="c256">a</b><b class="c16">,</b>&nbsp;<b class="c256">b</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">b</b>&nbsp;<b class="c1">in</b>&nbsp;<b class="c256">o</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">o</b><b class="c8">[</b><b class="c256">b</b><b class="c8">]</b><b class="c16">;</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">a</b><b class="c16">;</b>&nbsp;<b class="c16">}</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></b></li></ol></dd><dd><h3>Description:</h3><p class="description"> 简单的字符串模板处理,模板变量命名形式为 ${var_name}</p><h3>Example:</h3><fieldset class="example_code"><legend>Code</legend><ol><li>&nbsp;<b class="c64">'${name}&nbsp;say&nbsp;:&nbsp;${othername}&nbsp;get&nbsp;a&nbsp;${animal}'</b><b class="c8">.</b><b class="c256">process</b><b class="c16">(</b><b class="c16">{</b><b class="c4">name</b><b class="c8">:</b><b class="c64">'baboo'</b><b class="c16">,</b>&nbsp;<b class="c256">othername</b><b class="c8">:</b><b class="c64">'benny'</b><b class="c16">,</b>&nbsp;<b class="c256">animal</b><b class="c8">:</b><b class="c64">'cat'</b><b class="c16">}</b><b class="c16">)</b><b class="c16">;</b>&nbsp;<b class="c32">//'baboo&nbsp;say:&nbsp;benny&nbsp;get&nbsp;a&nbsp;cat'</b></b></li></ol></fieldset></dd><dt><b class="function_head"><a name="String.test" href="#String.test">test</a></b>&nbsp;<a href="javascript:void(0)" onclick="view_source(this)">hide source</a></dt><dd class="code" style="display:block"><ol><li><b class="c2">String</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">.</b><b class="c4">test</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c256">reg</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">reg</b><b class="c8">.</b><b class="c4">test</b><b class="c16">(</b><b class="c1">this</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></b></li></ol></dd><dd><h3>Description:</h3><p class="description"><br/> 对字符串做正则检测<br/>	 </p></dd><dt><b class="function_head"><a name="String.trim" href="#String.trim">trim</a></b>&nbsp;<a href="javascript:void(0)" onclick="view_source(this)">hide source</a></dt><dd class="code" style="display:block"><ol><li><b class="c2">String</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">.</b><b class="c256">trim</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c1">this</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/^[\s　]+|[\s　]+$/g</b><b class="c16">,</b>&nbsp;<b class="c64">''</b><b class="c16">)</b>&nbsp;<b class="c16">}</b><b class="c16">;</b></b></li></ol></dd><dd><h3>Description:</h3><p class="description"> 去除字符串的前后空白字符<br/>	 </p></dd><dt><b class="function_head"><a name="String.truncate" href="#String.truncate">truncate</a></b>&nbsp;<a href="javascript:void(0)" onclick="view_source(this)">hide source</a></dt><dd class="code" style="display:block"><ol><li><b class="c2">String</b><b class="c8">.</b><b class="c4">prototype</b><b class="c8">.</b><b class="c256">truncate</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">function</b><b class="c16">(</b><b class="c256">l</b><b class="c16">,</b>&nbsp;<b class="c256">t</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">var</b>&nbsp;<b class="c256">_t</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c1">this</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">l</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c256">l</b>&nbsp;<b class="c8">|</b><b class="c8">|</b>&nbsp;<b class="c128">30</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b><b class="c16">(</b><b class="c256">_t</b><b class="c8">.</b><b class="c4">replace</b><b class="c16">(</b><b class="c512">/[^\x00-\xff]/g</b><b class="c16">,</b>&nbsp;<b class="c64">'aa'</b><b class="c16">)</b><b class="c8">.</b><b class="c4">length</b>&nbsp;<b class="c8"><</b><b class="c8">=</b>&nbsp;<b class="c256">l</b><b class="c16">)</b>&nbsp;<b class="c1">return</b>&nbsp;<b class="c256">_t</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">t</b>&nbsp;<b class="c8">=</b><b class="c8">=</b><b class="c8">=</b>&nbsp;<b class="c256">undefined</b><b class="c16">)</b>&nbsp;<b class="c256">t</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c64">'...'</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c256">l</b>&nbsp;<b class="c8">-</b><b class="c8">=</b>&nbsp;<b class="c256">t</b><b class="c8">.</b><b class="c4">length</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">for</b>&nbsp;<b class="c16">(</b><b class="c1">var</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">,</b>&nbsp;<b class="c256">j</b>&nbsp;<b class="c8">=</b>&nbsp;<b class="c128">0</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8"><</b>&nbsp;<b class="c256">l</b><b class="c16">;</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c256">i</b><b class="c16">)</b>&nbsp;<b class="c16">{</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b><b class="c256">_t</b><b class="c8">.</b><b class="c4">charCodeAt</b><b class="c16">(</b><b class="c256">i</b>&nbsp;<b class="c8">-</b>&nbsp;<b class="c256">j</b><b class="c16">)</b>&nbsp;<b class="c8">></b>&nbsp;<b class="c128">0</b><b class="c256">xff</b><b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c256">i</b><b class="c16">;</b>&nbsp;<b class="c8">+</b><b class="c8">+</b><b class="c256">j</b><b class="c16">;</b>&nbsp;<b class="c16">}</b>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">if</b>&nbsp;<b class="c16">(</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">!</b><b class="c8">=</b>&nbsp;<b class="c256">l</b>&nbsp;<b class="c16">)</b>&nbsp;<b class="c16">{</b>&nbsp;<b class="c8">-</b><b class="c8">-</b><b class="c256">j</b><b class="c16">;</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">-</b><b class="c8">=</b><b class="c128">2</b><b class="c16">;</b>&nbsp;<b class="c16">}</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c1">return</b>&nbsp;&nbsp;<b class="c256">_t</b><b class="c8">.</b><b class="c4">slice</b><b class="c16">(</b><b class="c128">0</b><b class="c16">,</b>&nbsp;<b class="c256">i</b>&nbsp;<b class="c8">-</b>&nbsp;<b class="c256">j</b><b class="c16">)</b>&nbsp;<b class="c8">+</b>&nbsp;<b class="c256">t</b><b class="c16">;</b></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b class="c16">}</b><b class="c16">;</b></b></li></ol></dd><dd><h3>Description:</h3><p class="description"> 字符串截断，一个半角字符长度为1, 全角字符长度为2；截取后缀串的长度算在截取长度内。截取反缀默认为...<br/>	 </p></dd></dl><div id="name_index"><h3><a name="#name_index">名称索引</a><dl><dt><a href='#Array'>Array</a></dt><dd><a href='#Array.each'>each</a></dd><dd><a href='#Array.include'>include</a></dd><dd><a href='#Array.indexOf'>indexOf</a></dd><dd><a href='#Array.last'>last</a></dd></dl><dl><dt><a href='#Function'>Function</a></dt><dd><a href='#Function.bind'>bind</a></dd><dd><a href='#Function.bindAsEventListener'>bindAsEventListener</a></dd></dl><dl><dt><a href='#String'>String</a></dt><dd><a href='#String.camelize'>camelize</a></dd><dd><a href='#String.decode'>decode</a></dd><dd><a href='#String.encode'>encode</a></dd><dd><a href='#String.format'>format</a></dd><dd><a href='#String.getQueryParams'>getQueryParams</a></dd><dd><a href='#String.isEmpty'>isEmpty</a></dd><dd><a href='#String.process'>process</a></dd><dd><a href='#String.test'>test</a></dd><dd><a href='#String.trim'>trim</a></dd><dd><a href='#String.truncate'>truncate</a></dd></dl></h3></div><div id="pop_up"><a href="#name_index">查看名称索引</a></div></div>
</body>
</html>
